package priv.mill.aop;
import org.apache.log4j.Logger;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;

public class Daili {

	private static final Logger logger = Logger.getLogger(Daili.class);
	
	public void before(){
		logger.debug("代理公司进行宣传");
	}
	
	public void after(){
		logger.debug("房子卖了办理过户手续");
	}
	
	public void returnHandler(JoinPoint j, int r){
		logger.debug("房子抽取佣金十万，剩下"+(r-10));
	}
	
	public int around(ProceedingJoinPoint pjp)  {
		try {
			logger.debug("环绕通知前");
			Integer proceed = (Integer) pjp.proceed();
			logger.debug("环绕通知后");
			return proceed;
		} catch (Throwable e) {
			logger.debug("异常通知");
		}
		return 0;
	}
}
